<?php

namespace App\Admin\Actions\Grid\Tools\SwtTyGood;

use App\Admin\Actions\Grid\Tools\BaseTools;
use App\Admin\Forms\GetTyGoodsForm;
use Dcat\Admin\Admin;
use Dcat\Admin\Traits\HasPermissions;
use Dcat\Admin\Widgets\Modal;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;

class GetGoodsInSide extends BaseTools
{
	protected $title = '查询商品在库';

    public function render()
    {
        $form = GetTyGoodsForm::make();

        $button = '<button class="btn btn-success"><i class="feather icon-search"></i> <span>查询商品在库</span></button>';

        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button($button);
    }

    /**
     * @param Model|Authenticatable|HasPermissions|null $user
     *
     * @return bool
     */
    protected function authorize($user): bool
    {
        return true;
    }

    /**
     * @return array
     */
    protected function parameters()
    {
        return [];
    }
}
